/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CrashFrame.java
 *
 * Created on Jul 22, 2011, 3:10:16 PM
 */

package net.worlds.component;

import java.awt.Color;
import net.worlds.ui.UI;

/**
 *
 * @author Jacob
 */
public class CrashFrameSimple extends javax.swing.JFrame {

    /** Creates new form CrashFrame */
    public CrashFrameSimple(String stackTrace) {
        super("Something broke!");
        initComponents();
        stackTraceBox.setText(stackTrace);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        infoTextArea = new javax.swing.JTextArea();
        jScrollPane1 = new javax.swing.JScrollPane();
        stackTraceBox = new javax.swing.JTextArea();
        exitButton = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        infoTextArea.setEditable(false);
        infoTextArea.setBackground(new Color(0, 0, 0, 0));
        infoTextArea.setColumns(20);
        infoTextArea.setFont(new java.awt.Font("Tahoma", 0, 11)); // NOI18N
        infoTextArea.setLineWrap(true);
        infoTextArea.setRows(5);
        infoTextArea.setText("2DWorlds has crashed! :( If you want to help us fix the crash so it doesn't happen again, please post what you were doing on the forums along with this information:");
        infoTextArea.setWrapStyleWord(true);
        infoTextArea.setBorder(null);
        infoTextArea.setDisabledTextColor(new java.awt.Color(0, 0, 0));
        infoTextArea.setEnabled(false);

        stackTraceBox.setColumns(20);
        stackTraceBox.setEditable(false);
        stackTraceBox.setRows(5);
        jScrollPane1.setViewportView(stackTraceBox);

        exitButton.setText("Exit");
        exitButton.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                exitButtonActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(infoTextArea)
                    .addComponent(jScrollPane1)
                    .addComponent(exitButton, javax.swing.GroupLayout.Alignment.TRAILING))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(infoTextArea, javax.swing.GroupLayout.PREFERRED_SIZE, 54, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 177, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(exitButton)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void exitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_exitButtonActionPerformed
        System.exit(0);
    }//GEN-LAST:event_exitButtonActionPerformed

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton exitButton;
    private javax.swing.JTextArea infoTextArea;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JTextArea stackTraceBox;
    // End of variables declaration//GEN-END:variables

}
